<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="stylesheet" type="text/css" href="../css/reset.css" />
<link rel="stylesheet" type="text/css" href="../css/common.css" />
<link rel="stylesheet" type="text/css" href="../css/index.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<jsp:include page="/main/header.jsp"></jsp:include>
<title>수정 목록</title>
<%@ page import="com.popcorn.rmsystem.controller.*" %>
<%@ page import="com.popcorn.rmsystem.dao.*" %>
<%@ page import="com.popcorn.rmsystem.model.*" %>
<script type="text/javascript">
function NullCheck(){
	var form = document.rms;
	
	if(form.TEAM_NAME.value==''){
		alert("팀명을 입력하세요");
		form.TEAMNAME.focus();
	}
	else if(form.HP1.value==''){
		alert("지역번호을 입력하세요");
		form.HP1.focus();
	}
	else if(form.HP2.value==''){
		alert("중간 번호를 입력하세요");
		form.HP2.focus();
	}
	else if(form.HP3.value==''){
		alert("마지막 번호를 입력하세요");
		form.HP3.focus();
	}
	else if(form.TRANDATE.value==''){
		alert("날짜를 입력하세요");
		form.TRANDATE.focus();
	}
	else if(form.STARTTIME.value==''){
		alert("시작 시간을 입력하세요");
		form.STARTTIME.focus();
	}
	else if(form.ENDTIME.value==''){
		alert("끝 시간을 입력하세요");
		form.ENDTIME.focus();
	}
	else if(form.ROOMSIZE.value==''){
		alert("방 크기를 입력하세요");
		form.ROOMSIZE.focus();
	}
	else form.submit();
}
</script>
<body>
<%
	String idx = request.getParameter("idx");
	RMSystemModel model = (RMSystemModel) request.getAttribute("model");
	String DATE = model.getTRANDATE();
	String uDATE = DATE.substring(0, 4);
					uDATE +="-";
					uDATE += DATE.substring(4, 6);
					uDATE +="-";
					uDATE += DATE.substring(6, DATE.length());
	
	String [] HP = model.getHP().split("-");
%>
<br><br><br><br><br><br><br><br><br>
<div class="content_inner">
   <div class="container">
      <div class="container_inner clearfix">
<div class="wrap">
	<h1 align="center" style="text-align: center;">수정 입력</h1> 
	<div class="table" style="width: 500px;">
	<div class="textinput"><%= "No."+idx %></div>
		<form name="rms" method="post" action="./RMSUpdateDB.bo">
		<input type="hidden" name="RMS_IDX" id="RMS_IDX" value="<%=idx%>">
	<div class="textinput" style="background-color: white;">팀 명 : <input TYPE="text" NAME="TEAM_NAME" ID="TEAM_NAME" value="<%=model.getTEAM_NAME()%>" style="width: 50px; border: 0px;"></div>
	<div class="textinput" style="background-color: white;">이 름 : &nbsp;&nbsp;<%=model.getNAME()%></div>
	<div class="textinput" style="background-color: white;">&nbsp;H P&nbsp; : &nbsp;<select name="HP1" style="border: 0px;">
		    <option value="" <% if("".equals(HP[0])) out.print("selected=\"selected\""); %>>번호선택</option>
		    <option value="010" <% if("010".equals(HP[0])) out.print("selected=\"selected\""); %>>010</option>
		    <option value="02" <% if("02".equals(HP[0])) out.print("selected=\"selected\""); %>>02</option>
		    <option value="011" <% if("011".equals(HP[0])) out.print("selected=\"selected\""); %>>011</option>
		  </select>&nbsp;-
		  <input TYPE="text" NAME="HP2" ID="HP2" size="4" value="<%=HP[1]%>" style="width: 50px; border: 0px;">&nbsp;-
		  <input TYPE="text" NAME="HP3" ID="HP3" size="4" value="<%=HP[2]%>" style="width: 50px; border: 0px;"></div>
	<div class="textinput" style="background-color: white;">날 짜 : <input TYPE="date" min="2001-01-01" max="2020-08-31" step=1 value="<%=uDATE%>" NAME="TRANDATE" ID="TRANDATE" style="width: 150px; border: 0px;"></div>
	<div class="textinput" style="background-color: white;">시 간 : <input TYPE="text" NAME="STARTTIME" ID="STARTTIME" size="2" value="<%=model.getSTARTTIME()%>" style="width: 50px; border: 0px;">
		  ~<input TYPE="text" NAME="ENDTIME" ID="ENDTIME" size="2" value="<%=model.getENDTIME()%>" style="width: 50px; border: 0px;">
	<font SIZE="2">&nbsp;※&nbsp;24시간&nbsp;기준(OPEN&nbsp;10:00/CLOSE&nbsp;22:00)</font></div>
	<div class="textinput" style="background-color: white;">크 기 : &nbsp;<select name="ROOMSIZE" style="border: 0px;">
		    <option value="" <% if("".equals(model.getROOMSIZE())) out.print("selected=\"selected\""); %>>방 선택</option>
		    <option value="02~04" <% if("02~04".equals(model.getROOMSIZE())) out.print("selected=\"selected\""); %>>2 ~ 4명</option>
		    <option value="03~05" <% if("03~05".equals(model.getROOMSIZE())) out.print("selected=\"selected\""); %>>3 ~ 5명</option>
		    <option value="05~06" <% if("05~06".equals(model.getROOMSIZE())) out.print("selected=\"selected\""); %>>5 ~ 6명</option>
		    <option value="07~08" <% if("07~08".equals(model.getROOMSIZE())) out.print("selected=\"selected\""); %>>7 ~ 8명</option>
		    <option value="09" <% if("09".equals(model.getROOMSIZE())) out.print("selected=\"selected\""); %>>9인이상</option>
		  </select></div>
		<input TYPE="button" value="수정" onclick="NullCheck();" style="width: 248px;">
		<input TYPE="button" value="목록" onclick="window.location.href='RMSListDB.bo'"  style="width: 248px;">
		</form>
</div></div></div></div></div>
</body>
</html>